package yifeng.serializable;

import java.io.Serializable;

public class Manager implements Serializable{
	private String name;
	private int level;
	private static Manager instance;
	
	public static Manager getInstance(){
		if(instance == null){
			instance = new Manager();
		}
		
		return instance;
	}
	
	private Object readResolve(){
		instance = this;
		return instance;
	}
	
	
	private Manager() {
		super();
		System.out.println("Creating a Manager.");
	}
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public int getLevel() {
		return level;
	}
	public void setLevel(int level) {
		this.level = level;
	}
	
	
}
